package main

import "fmt"

// 入参是 字符串类型的slice 指针
func reclassify(planets *[]string) {
	*planets = (*planets)[0:8]
}

// slice 指向数组
func main() {
	// slice
	planets := []string{
		"1", "2", "3", "4",
		"5", "6", "7", "8",
		"9",
	}
	fmt.Println(planets)
	fmt.Println(len(planets), cap(planets))
	reclassify(&planets)

	fmt.Println(planets)
	fmt.Println(len(planets), cap(planets))

	planets = append(planets, "10", "11")
	fmt.Println(planets)
	fmt.Println(len(planets), cap(planets))
}
